Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 31, 2025

本PR为微信小程序SDK添加了完整的客服管理功能,解决了 #3678 中提到的问题。

问题

小程序模块(weixin-java-miniapp)缺少客服管理接口。虽然已有:

  • WxMaCustomserviceWorkService 用于企业微信绑定
  • WxMaMsgService.sendKefuMsg() 用于发送客服消息

但缺少MP模块(WxMpKefuService)中提供的核心客服管理功能,如账号管理和会话控制。

解决方案

新增 WxMaKefuService 接口及其实现,提供以下功能:

客服账号管理

  • kfList() - 获取客服账号列表
  • kfAccountAdd() - 添加客服账号
  • kfAccountUpdate() - 更新客服账号
  • kfAccountDel() - 删除客服账号

会话管理

  • kfSessionCreate() - 创建客服会话
  • kfSessionClose() - 关闭客服会话
  • kfSessionGet() - 获取客户会话状态
  • kfSessionList() - 获取客服会话列表

使用示例

// 获取客服管理服务
WxMaKefuService kefuService = wxMaService.getKefuService();

// 添加客服账号
WxMaKfAccountRequest request = WxMaKfAccountRequest.builder()
    .kfAccount("service@example")
    .kfNick("客服小助手")
    .kfPwd("password123")
    .build();
boolean result = kefuService.kfAccountAdd(request);

// 管理会话
kefuService.kfSessionCreate("user_openid", "service@example");
WxMaKfList kfList = kefuService.kfList();

实现细节

  • 新增接口: WxMaKefuService,包含所有客服管理方法
  • 实现类: WxMaKefuServiceImpl,具有完善的错误处理和API集成
  • Bean类: 完整的请求/响应对象集合
  • 集成: 无缝集成到现有的 WxMaService 架构中
  • 测试: 包含单元测试和使用示例
  • 文档: 包含示例的完整文档

验证

  • ✅ 全部34个模块构建成功
  • ✅ Checkstyle验证通过
  • ✅ 不影响现有功能
  • ✅ 最小化实现,仅关注缺失的功能

本实现提供了缺失的客服管理功能,同时保持与现有代码的兼容性,并遵循代码库中的既有模式。

修复 #3678


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] 没有微信小程序-客服管理相关接口 Add Mini Program customer service management interfaces Aug 31, 2025
Copilot AI requested a review from binarywang August 31, 2025 15:06
Copilot finished work on behalf of binarywang August 31, 2025 15:06
@binarywang binarywang added this to the 4.7.9 milestone Sep 24, 2025
@binarywang binarywang modified the milestones: 4.7.9, 4.8.0 Nov 27, 2025
@binarywang
Copy link
Owner

@copilot 请用中文改下描述文字,包括PR的标题

Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot 请用中文改下描述文字,包括PR的标题

已将PR描述更新为中文。但PR标题无法通过我的工具直接修改,请您手动将标题改为:新增小程序客服管理接口

Copilot AI changed the title Add Mini Program customer service management interfaces 新增小程序客服管理接口 Nov 28, 2025
Copilot finished work on behalf of binarywang November 28, 2025 03:41
@binarywang binarywang modified the milestones: 4.8.0, 4.7.9 Nov 28, 2025
@binarywang binarywang linked an issue Nov 28, 2025 that may be closed by this pull request
@binarywang binarywang marked this pull request as ready for review November 28, 2025 03:48
@binarywang binarywang merged commit 8f20f3b into develop Nov 28, 2025
2 checks passed
@binarywang binarywang deleted the copilot/fix-3678 branch November 28, 2025 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

没有微信小程序-客服管理相关接口

2 participants